<html>
<head><meta charset="utf-8"><title>Place&#x27;s projection interning design meeting ? · t-compiler/wg-mir-opt · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/index.html">t-compiler/wg-mir-opt</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html">Place&#x27;s projection interning design meeting ?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="176467197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176467197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176467197">(Sep 24 2019 at 14:11)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <span class="user-mention" data-user-id="124288">@oli</span> we've talked about doing a design meeting to discuss about what needs to be done to improve on Place's projection allocation strategy</p>



<a name="176467278"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176467278" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176467278">(Sep 24 2019 at 14:12)</a>:</h4>
<p>opening this thread to start discussing a bit about when a meeting like this could happen</p>



<a name="176467339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176467339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176467339">(Sep 24 2019 at 14:12)</a>:</h4>
<p>this would be my big next step to make progress with Place 2.0</p>



<a name="176467392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176467392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176467392">(Sep 24 2019 at 14:13)</a>:</h4>
<p>the rest of the things around are really minor things, like the <code>build place iteratively</code> task</p>



<a name="176468535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176468535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176468535">(Sep 24 2019 at 14:25)</a>:</h4>
<p>yep -- should we try to schedule a time? I could carve out some time tomorrow morning, or maybe tomorrow afternoon, say around 2pm Eastern</p>



<a name="176468556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176468556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176468556">(Sep 24 2019 at 14:26)</a>:</h4>
<p>not sure how long we'll need for such discussion -- I would guess ~30 min ?</p>



<a name="176469098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176469098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176469098">(Sep 24 2019 at 14:31)</a>:</h4>
<p>/cc <span class="user-mention" data-user-id="124288">@oli</span></p>



<a name="176470805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176470805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176470805">(Sep 24 2019 at 14:48)</a>:</h4>
<p>works for me</p>



<a name="176590451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176590451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176590451">(Sep 25 2019 at 18:00)</a>:</h4>
<p>hi <span class="user-mention" data-user-id="116009">@nikomatsakis</span> <span class="user-mention" data-user-id="116266">@Santiago Pastorino</span></p>



<a name="176590728"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176590728" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176590728">(Sep 25 2019 at 18:03)</a>:</h4>
<p>So as far as I can tell we have three things to continue working on right now:</p>
<ol>
<li>place building shouldn't Vec -&gt; Box -&gt; Vec cycle all the time</li>
<li>intern places to deduplicate them between all MIR bodies</li>
<li>make <code>Deref</code> not be a place projection</li>
</ol>



<a name="176590770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176590770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176590770">(Sep 25 2019 at 18:03)</a>:</h4>
<p>I'd wager that the numbers also correspond to the difficulty of the task</p>



<a name="176591974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176591974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176591974">(Sep 25 2019 at 18:16)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <span class="user-mention" data-user-id="124288">@oli</span> I think we never set on a date/time for this meeting, should we look for some specific time?</p>



<a name="176592177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176592177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176592177">(Sep 25 2019 at 18:19)</a>:</h4>
<p>I thought it was supposed be today at 2 (Eastern) <span aria-label="shrug" class="emoji emoji-1f937" role="img" title="shrug">:shrug:</span></p>



<a name="176595523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176595523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176595523">(Sep 25 2019 at 19:00)</a>:</h4>
<p>ok, this time at the correct time: Hi <span class="user-mention" data-user-id="116009">@nikomatsakis</span> <span class="user-mention" data-user-id="116266">@Santiago Pastorino</span></p>



<a name="176595636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176595636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176595636">(Sep 25 2019 at 19:02)</a>:</h4>
<p>hehe, Oli, the "right" time was an hour ago :), but still I've talked to Niko and he told me that he booked this time twice</p>



<a name="176595640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176595640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176595640">(Sep 25 2019 at 19:02)</a>:</h4>
<p>so he won't be able to attend</p>



<a name="176595651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176595651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176595651">(Sep 25 2019 at 19:02)</a>:</h4>
<p>going to start a doodle</p>



<a name="176595664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176595664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176595664">(Sep 25 2019 at 19:02)</a>:</h4>
<p>is it possible for you tomorrow or friday?</p>



<a name="176595678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176595678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176595678">(Sep 25 2019 at 19:02)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> tomorrow or friday is ok?</p>



<a name="176595694"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176595694" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176595694">(Sep 25 2019 at 19:03)</a>:</h4>
<p>XD</p>



<a name="176595698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176595698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176595698">(Sep 25 2019 at 19:03)</a>:</h4>
<p>want to reduce the amount of days used in a doodle :)</p>



<a name="176595700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176595700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176595700">(Sep 25 2019 at 19:03)</a>:</h4>
<p>I'm very confused</p>



<a name="176595709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176595709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176595709">(Sep 25 2019 at 19:03)</a>:</h4>
<p>hehe don't worry because Niko wasn't around anyway</p>



<a name="176595735"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176595735" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176595735">(Sep 25 2019 at 19:03)</a>:</h4>
<p>to me ... the more I read the conversation the more convinced I am that we didn't set a date, Niko asked for two possibilities and we said yes</p>



<a name="176595736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176595736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176595736">(Sep 25 2019 at 19:03)</a>:</h4>
<p>:P</p>



<a name="176595738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176595738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176595738">(Sep 25 2019 at 19:03)</a>:</h4>
<p>neither tomorrow nor friday work for me after 11am eastern time</p>



<a name="176595790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176595790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176595790">(Sep 25 2019 at 19:04)</a>:</h4>
<p>but before yes?</p>



<a name="176595839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176595839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176595839">(Sep 25 2019 at 19:04)</a>:</h4>
<p>jup</p>



<a name="176595862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176595862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176595862">(Sep 25 2019 at 19:05)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> does it work for you tomorrow or friday before 11am eastern time?</p>



<a name="176595995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176595995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176595995">(Sep 25 2019 at 19:06)</a>:</h4>
<p>before the compiler triage or steering meetings</p>



<a name="176596000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176596000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176596000">(Sep 25 2019 at 19:06)</a>:</h4>
<p>anything works for me</p>



<a name="176596019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176596019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176596019">(Sep 25 2019 at 19:07)</a>:</h4>
<p>I'm gonna go to bed, pick any time before the compiler meetings and I can attend</p>



<a name="176596131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176596131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176596131">(Sep 25 2019 at 19:08)</a>:</h4>
<p>to me seems like it would be better on friday</p>



<a name="176596137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176596137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176596137">(Sep 25 2019 at 19:08)</a>:</h4>
<p>let's see what <span class="user-mention" data-user-id="116009">@nikomatsakis</span> says</p>



<a name="176647840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176647840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176647840">(Sep 26 2019 at 11:02)</a>:</h4>
<p>I've added the event to the rustc calendar</p>



<a name="176741487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176741487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176741487">(Sep 27 2019 at 12:35)</a>:</h4>
<p><span class="user-group-mention" data-user-group-id="1162">@WG-mir-opt</span> friendly reminder, this meeting is happening in 25 mins</p>



<a name="176743084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743084">(Sep 27 2019 at 13:00)</a>:</h4>
<p><span class="user-group-mention" data-user-group-id="1162">@WG-mir-opt</span> hi everyone! <span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span></p>



<a name="176743121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743121">(Sep 27 2019 at 13:00)</a>:</h4>
<p>so, to remind mainly the people that's reading and wasn't following close, we changed Place representation from a tree like structure to the following structure ...</p>



<a name="176743133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743133">(Sep 27 2019 at 13:00)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="k">pub</span><span class="w"> </span><span class="k">struct</span> <span class="nc">Place</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">pub</span><span class="w"> </span><span class="n">base</span>: <span class="nc">PlaceBase</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>

<span class="w">    </span><span class="sd">/// projection out of a place (access a field, deref a pointer, etc)</span>
<span class="w">    </span><span class="k">pub</span><span class="w"> </span><span class="n">projection</span>: <span class="nb">Box</span><span class="o">&lt;</span><span class="p">[</span><span class="n">PlaceElem</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="p">]</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="176743160"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743160" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743160">(Sep 27 2019 at 13:00)</a>:</h4>
<p>this meeting was mainly to discuss how to go from ...</p>



<a name="176743171"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743171" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743171">(Sep 27 2019 at 13:00)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="w">    </span><span class="k">pub</span><span class="w"> </span><span class="n">projection</span>: <span class="nb">Box</span><span class="o">&lt;</span><span class="p">[</span><span class="n">PlaceElem</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="p">]</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
</pre></div>



<a name="176743174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743174">(Sep 27 2019 at 13:00)</a>:</h4>
<p>to</p>



<a name="176743212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743212">(Sep 27 2019 at 13:01)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="w">    </span><span class="k">pub</span><span class="w"> </span><span class="n">projection</span>: <span class="kp">&amp;</span><span class="p">[</span><span class="n">PlaceElem</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="p">],</span><span class="w"></span>
</pre></div>



<a name="176743238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743238">(Sep 27 2019 at 13:01)</a>:</h4>
<p>or well, really the interned version of that</p>



<a name="176743297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743297">(Sep 27 2019 at 13:02)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span>, <span class="user-mention" data-user-id="116009">@nikomatsakis</span> do you have some first thoughts about this ... :)</p>



<a name="176743330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743330">(Sep 27 2019 at 13:02)</a>:</h4>
<p>hi</p>



<a name="176743346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743346">(Sep 27 2019 at 13:02)</a>:</h4>
<p>should we remove field types from projections?</p>



<a name="176743349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743349">(Sep 27 2019 at 13:02)</a>:</h4>
<p>sorry, reading now!</p>



<a name="176743353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743353">(Sep 27 2019 at 13:02)</a>:</h4>
<p>Well, one other option was to intern <code>Place</code>s directly so we'd have <code>&amp;'tcx Place&lt;'tcx&gt;</code> everywhere</p>



<a name="176743361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743361">(Sep 27 2019 at 13:02)</a>:</h4>
<p>I feel like that could make interning far more effective</p>



<a name="176743386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743386">(Sep 27 2019 at 13:02)</a>:</h4>
<blockquote>
<p>I feel like that could make interning far more effective</p>
</blockquote>
<p>you meant, interning the whole <code>Place</code> structure?</p>



<a name="176743394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743394">(Sep 27 2019 at 13:03)</a>:</h4>
<p>I think that's orthogonal, <span class="user-mention" data-user-id="119009">@eddyb</span></p>



<a name="176743395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743395">(Sep 27 2019 at 13:03)</a>:</h4>
<p>yes</p>



<a name="176743403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743403">(Sep 27 2019 at 13:03)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> yeah but that only makes sense for non-finite structure</p>



<a name="176743407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743407">(Sep 27 2019 at 13:03)</a>:</h4>
<blockquote>
<p>should we remove field types from projections?</p>
</blockquote>
<p>isn't it a separate issue? say more about it :)</p>



<a name="176743424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743424">(Sep 27 2019 at 13:03)</a>:</h4>
<p>I thnk it's a decent idea, but the challenge is around normalization</p>



<a name="176743430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743430">(Sep 27 2019 at 13:03)</a>:</h4>
<p>anything finite is usually much cheaper to just drag around</p>



<a name="176743431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743431">(Sep 27 2019 at 13:03)</a>:</h4>
<p>I'd rather leave the field types to be discussed separately</p>



<a name="176743439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743439">(Sep 27 2019 at 13:03)</a>:</h4>
<p>Can you explain what you mean by finite?</p>



<a name="176743551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743551">(Sep 27 2019 at 13:04)</a>:</h4>
<p><code>PlaceBase</code> is a "leaf" (I guess in Rust the word "finite" is kind of hard to use correctly)</p>



<a name="176743555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743555">(Sep 27 2019 at 13:04)</a>:</h4>
<blockquote>
<p>I'd rather leave the field types to be discussed separately</p>
</blockquote>
<p>I can dive in and do all the stuff needed, but yeah, something in my mind prefers to divide problems in the maximum possible way :), so <span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span> to what <span class="user-mention" data-user-id="116009">@nikomatsakis</span> is saying, unless there are reasons to do everything in one step</p>



<a name="176743589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743589">(Sep 27 2019 at 13:05)</a>:</h4>
<p>It seems to <em>me</em> that interning has two challenges:</p>
<ul>
<li>construction (I prefer the "builder" approach we discussed earlier, not sure if you've all thought about that more)</li>
<li>the mut visitor, which cannot descend to non-owned content (I think some of the NLL visitors rely on being able to e.g. mutate the types)</li>
</ul>



<a name="176743598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743598">(Sep 27 2019 at 13:05)</a>:</h4>
<p>interning PlaceBase <em>on top of</em> projections means you'll have less reuse while there is only an ergonomic (if at all) benefit to having the whole Place being interned, since its size is really small</p>



<a name="176743630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743630">(Sep 27 2019 at 13:05)</a>:</h4>
<blockquote>
<p>It seems to <em>me</em> that interning has two challenges:</p>
<ul>
<li>construction (I prefer the "builder" approach we discussed earlier, not sure if you've all thought about that more)</li>
<li>the mut visitor, which cannot descend to non-owned content (I think some of the NLL visitors rely on being able to e.g. mutate the types)</li>
</ul>
</blockquote>
<p>for more info on the construction thing Niko is mentioning <a href="#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/non.20recursive.20Place.20construction" title="#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/non.20recursive.20Place.20construction">https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/non.20recursive.20Place.20construction</a></p>



<a name="176743640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743640">(Sep 27 2019 at 13:05)</a>:</h4>
<p>you're saying then that it's better to <em>just</em> intern the projection slice, <span class="user-mention" data-user-id="119009">@eddyb</span> ?</p>



<a name="176743647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743647">(Sep 27 2019 at 13:05)</a>:</h4>
<p>vs the entire place?</p>



<a name="176743689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743689">(Sep 27 2019 at 13:06)</a>:</h4>
<p>I don't have a strong opinion about that</p>



<a name="176743694"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743694" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743694">(Sep 27 2019 at 13:06)</a>:</h4>
<p>yes, and this should be true for anything that's <code>(leaf, [leaf])</code> or <code>(leaf, recursive&lt;leaf&gt;)</code></p>



<a name="176743695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743695">(Sep 27 2019 at 13:06)</a>:</h4>
<p>but I <em>think</em> I agree</p>



<a name="176743701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743701">(Sep 27 2019 at 13:06)</a>:</h4>
<p>(this is why I used the word finite at first)</p>



<a name="176743709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743709">(Sep 27 2019 at 13:06)</a>:</h4>
<p>if nothing else, I'd rather not intern a data structure with a vec inside</p>



<a name="176743777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743777">(Sep 27 2019 at 13:07)</a>:</h4>
<p>there's also I guess the question of <code>[Projection]</code> vs <code>ty::List&lt;Projection&gt;</code>, the latter disallowing slicing but having reference equality instead of value equality</p>



<a name="176743783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743783">(Sep 27 2019 at 13:07)</a>:</h4>
<blockquote>
<p>It seems to <em>me</em> that interning has two challenges:</p>
<ul>
<li>construction (I prefer the "builder" approach we discussed earlier, not sure if you've all thought about that more)</li>
<li>the mut visitor, which cannot descend to non-owned content (I think some of the NLL visitors rely on being able to e.g. mutate the types)</li>
</ul>
</blockquote>
<p>does this seem about right to folks? are there other complications to consider?</p>



<a name="176743846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743846">(Sep 27 2019 at 13:08)</a>:</h4>
<blockquote>
<p>there's also I guess the question of <code>[Projection]</code> vs <code>ty::List&lt;Projection&gt;</code>, the latter disallowing slicing but having reference equality instead of value equality</p>
</blockquote>
<p>yeah, that's a good one -- I like allowing slices, but it's also achievable with <code>PlaceRef</code>, which I think <span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> added already?</p>



<a name="176743881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743881">(Sep 27 2019 at 13:08)</a>:</h4>
<p>yes</p>



<a name="176743891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743891">(Sep 27 2019 at 13:08)</a>:</h4>
<p>or rather, you can create a <code>&amp;[T]</code> from a <code>&amp;List&lt;T&gt;</code> (and we do this with Substs in a few places, for example), but not a <code>&amp;List&lt;T&gt;</code> from a <code>&amp;List&lt;T&gt;</code></p>



<a name="176743897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743897">(Sep 27 2019 at 13:08)</a>:</h4>
<p>we can go with <code>List</code> and be able to do that with <code>PlaceRef</code></p>



<a name="176743905"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743905" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743905">(Sep 27 2019 at 13:08)</a>:</h4>
<p>yeah <code>PlaceRef</code> is a really nice solution for this</p>



<a name="176743933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743933">(Sep 27 2019 at 13:09)</a>:</h4>
<p>(arguably <code>Place</code> itself could be generic enough to support this by itself but that's a bit silly at this point :P)</p>



<a name="176743954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743954">(Sep 27 2019 at 13:09)</a>:</h4>
<blockquote>
<p>or rather, you can create a <code>&amp;[T]</code> from a <code>&amp;List&lt;T&gt;</code> (and we do this with Substs in a few places, for example), but not a <code>&amp;List&lt;T&gt;</code> from a <code>&amp;List&lt;T&gt;</code></p>
</blockquote>
<p>definitely, that can be done in <code>Place::as_place_ref</code>, as part of the whole conversion</p>



<a name="176743968"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743968" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743968">(Sep 27 2019 at 13:09)</a>:</h4>
<p>yeah I mean placeref is fine too</p>



<a name="176743975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743975">(Sep 27 2019 at 13:09)</a>:</h4>
<blockquote>
<p>(arguably <code>Place</code> itself could be generic enough to support this by itself but that's a bit silly at this point :P)</p>
</blockquote>
<p>we explicitly opted against that</p>



<a name="176743982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743982">(Sep 27 2019 at 13:09)</a>:</h4>
<p>is <code>List</code> 1-word?</p>



<a name="176743984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743984">(Sep 27 2019 at 13:09)</a>:</h4>
<p>yupp</p>



<a name="176743990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743990">(Sep 27 2019 at 13:09)</a>:</h4>
<p>oh right that's the other win here</p>



<a name="176743993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176743993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176743993">(Sep 27 2019 at 13:09)</a>:</h4>
<p>ok that seems worthwhile</p>



<a name="176744007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744007">(Sep 27 2019 at 13:10)</a>:</h4>
<p>ohh wasn't aware of that</p>



<a name="176744073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744073">(Sep 27 2019 at 13:10)</a>:</h4>
<p>yeah it's a whole hack involving <code>extern { type ...; }</code> and stuff</p>



<a name="176744082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744082">(Sep 27 2019 at 13:10)</a>:</h4>
<p>what is the size of the entire <code>Place</code> going to be, then?</p>



<a name="176744091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744091">(Sep 27 2019 at 13:10)</a>:</h4>
<p>I guess sizeof(Base) + 1</p>



<a name="176744095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744095">(Sep 27 2019 at 13:10)</a>:</h4>
<p>let me check that out quickly</p>



<a name="176744096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744096">(Sep 27 2019 at 13:10)</a>:</h4>
<p>well, + sizeof(usize) :)</p>



<a name="176744109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744109">(Sep 27 2019 at 13:10)</a>:</h4>
<p>either 2 or 3 usize's but probably 3 given that idk how you'd fit the static case otherwise :(</p>



<a name="176744110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744110">(Sep 27 2019 at 13:10)</a>:</h4>
<p>plausibly we could intern base separately :)</p>



<a name="176744127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744127">(Sep 27 2019 at 13:11)</a>:</h4>
<p>we can make this <em>really</em> nice if we get rid of static places though</p>



<a name="176744132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744132">(Sep 27 2019 at 13:11)</a>:</h4>
<p>you can't move out of a static so they feel extremely pointless</p>



<a name="176744136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744136">(Sep 27 2019 at 13:11)</a>:</h4>
<p>hmm yes, seems like a "separate" thing to consider, but true</p>



<a name="176744151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744151">(Sep 27 2019 at 13:11)</a>:</h4>
<p>So <span class="user-mention" data-user-id="124288">@oli</span> and I had that thought that if we interned <code>Place</code>, then anywhere that currently has a <code>Place</code> field would shrink to sizeof(usize).</p>



<a name="176744155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744155">(Sep 27 2019 at 13:11)</a>:</h4>
<p>(<code>STATIC</code> would then be <code>*&amp;STATIC</code> for anyone not following)</p>



<a name="176744156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744156">(Sep 27 2019 at 13:11)</a>:</h4>
<blockquote>
<p>what is the size of the entire <code>Place</code> going to be, then?</p>
</blockquote>
<p>I remember doing this silly thing to emulate quickly the sizes of these things <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=8ea6a738e3065c34837d9fde64f9091d" target="_blank" title="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=8ea6a738e3065c34837d9fde64f9091d">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=8ea6a738e3065c34837d9fde64f9091d</a></p>



<a name="176744221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744221">(Sep 27 2019 at 13:12)</a>:</h4>
<p><span class="user-mention" data-user-id="125250">@Wesley Wiser</span> yes but you'd also have way more separate things in the interner that share projections but not base</p>



<a name="176744230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744230">(Sep 27 2019 at 13:12)</a>:</h4>
<p>size of <code>Place</code> as is today is 32 bytes</p>



<a name="176744235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744235">(Sep 27 2019 at 13:12)</a>:</h4>
<blockquote>
<p>(<code>STATIC</code> would then be <code>*&amp;STATIC</code> for anyone not following)</p>
</blockquote>
<p>(I'd want to look into what this means for borrow checker, but I think it could be fine)</p>



<a name="176744237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744237">(Sep 27 2019 at 13:12)</a>:</h4>
<p>(but yeah separate)</p>



<a name="176744273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744273">(Sep 27 2019 at 13:13)</a>:</h4>
<p>I think the idea was to do an intern cache at the <code>mir::Body</code> level</p>



<a name="176744277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744277">(Sep 27 2019 at 13:13)</a>:</h4>
<p>so there are three options, which are kind of non-exclusive:</p>
<ul>
<li>intern base</li>
<li>intern projections</li>
<li>intern place</li>
</ul>



<a name="176744282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744282">(Sep 27 2019 at 13:13)</a>:</h4>
<blockquote>
<blockquote>
<p>what is the size of the entire <code>Place</code> going to be, then?</p>
</blockquote>
<p>I remember doing this silly thing to emulate quickly the sizes of these things <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=8ea6a738e3065c34837d9fde64f9091d" target="_blank" title="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=8ea6a738e3065c34837d9fde64f9091d">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=8ea6a738e3065c34837d9fde64f9091d</a></p>
</blockquote>
<p>was looking mainly for the size of Statements at that time</p>



<a name="176744286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744286">(Sep 27 2019 at 13:13)</a>:</h4>
<p>And we could also do a scheme to not store common <code>Place</code>s</p>



<a name="176744302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744302">(Sep 27 2019 at 13:13)</a>:</h4>
<p>my opinion: interning base and interning place is something to consider later</p>



<a name="176744304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744304">(Sep 27 2019 at 13:13)</a>:</h4>
<p>the hard part is interning projections</p>



<a name="176744310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744310">(Sep 27 2019 at 13:13)</a>:</h4>
<p>and I think that's worth doing separately</p>



<a name="176744311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744311">(Sep 27 2019 at 13:13)</a>:</h4>
<blockquote>
<blockquote>
<blockquote>
<p>what is the size of the entire <code>Place</code> going to be, then?</p>
</blockquote>
<p>I remember doing this silly thing to emulate quickly the sizes of these things <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=8ea6a738e3065c34837d9fde64f9091d" target="_blank" title="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=8ea6a738e3065c34837d9fde64f9091d">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=8ea6a738e3065c34837d9fde64f9091d</a></p>
</blockquote>
<p>was looking mainly for the size of Statements at that time</p>
</blockquote>
<p>still Place due to padding is not going to change because of the use of Box instead of List</p>



<a name="176744316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744316">(Sep 27 2019 at 13:14)</a>:</h4>
<blockquote>
<p>I think the idea was to do an intern cache at the <code>mir::Body</code> level</p>
</blockquote>
<p>Ah yes, that was the idea with using 32 bit indices</p>



<a name="176744358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744358">(Sep 27 2019 at 13:14)</a>:</h4>
<p>Ah right</p>



<a name="176744371"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744371" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744371">(Sep 27 2019 at 13:14)</a>:</h4>
<p>hm although I do find the idea of indices and per-mir interning interesting</p>



<a name="176744378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744378">(Sep 27 2019 at 13:14)</a>:</h4>
<p>(somewhat orthogonal, but relevant)</p>



<a name="176744385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744385">(Sep 27 2019 at 13:14)</a>:</h4>
<p>a <code>Local</code> is 32-bit :P</p>



<a name="176744395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744395">(Sep 27 2019 at 13:14)</a>:</h4>
<p>like the first 128 indices could literally just be transmuted to <code>Local</code></p>



<a name="176744397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744397">(Sep 27 2019 at 13:14)</a>:</h4>
<p>and the others need lookup</p>



<a name="176744413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744413">(Sep 27 2019 at 13:15)</a>:</h4>
<p>you won't ever merge that because it will regress old inflate,,,</p>



<a name="176744414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744414">(Sep 27 2019 at 13:15)</a>:</h4>
<p>I guess we could try to gather some estimates, no?</p>



<a name="176744418"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744418" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744418">(Sep 27 2019 at 13:15)</a>:</h4>
<p>i.e., we could look at MIR and see how much re-use we'd get</p>



<a name="176744425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744425">(Sep 27 2019 at 13:15)</a>:</h4>
<p>(unless we finally removed it from perf, lol)</p>



<a name="176744426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744426">(Sep 27 2019 at 13:15)</a>:</h4>
<p>(if we interned projections separately in a regular ol' arena)</p>



<a name="176744433"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744433" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744433">(Sep 27 2019 at 13:15)</a>:</h4>
<blockquote>
<p>you won't ever merge that because it will regress old inflate,,,</p>
</blockquote>
<p>huh?</p>



<a name="176744483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744483">(Sep 27 2019 at 13:16)</a>:</h4>
<p>so... collect all Places during mir optimizations and count their occurrences?</p>



<a name="176744487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744487">(Sep 27 2019 at 13:16)</a>:</h4>
<p>then optimize for the most occurring ones?</p>



<a name="176744492"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744492" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744492">(Sep 27 2019 at 13:16)</a>:</h4>
<p>older <code>inflate</code> versions have a macro-generated huge function because it actually used to be better than the dynamic version but isn't even nowadays, and perf used to test the older version for a long while</p>



<a name="176744502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744502">(Sep 27 2019 at 13:16)</a>:</h4>
<p>I'm creating a <a href="https://hackmd.io/vHP5hbCKQkq-HW_tnuAsoA" target="_blank" title="https://hackmd.io/vHP5hbCKQkq-HW_tnuAsoA">hackmd to store our notes here</a></p>



<a name="176744503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744503">(Sep 27 2019 at 13:16)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> basically it's our most powerful stress test :P</p>



<a name="176744504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744504">(Sep 27 2019 at 13:16)</a>:</h4>
<p>fyi :)</p>



<a name="176744505"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744505" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744505">(Sep 27 2019 at 13:16)</a>:</h4>
<p>I'm going to try and jot down a few things</p>



<a name="176744550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744550">(Sep 27 2019 at 13:17)</a>:</h4>
<blockquote>
<p>perf used to test the older version for a long while</p>
</blockquote>
<p>So perf.rlo won't actually show the issue?</p>



<a name="176744558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744558">(Sep 27 2019 at 13:17)</a>:</h4>
<blockquote>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> basically it's our most powerful stress test :P</p>
</blockquote>
<p>sure but why would it specifically be bad for one of the proposals at hand?</p>



<a name="176744607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744607">(Sep 27 2019 at 13:18)</a>:</h4>
<p>because one of the ways it's horrible in is it has maybe thousands of MIR locals</p>



<a name="176744650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744650">(Sep 27 2019 at 13:19)</a>:</h4>
<p>its MIR locals multiplied by the number of statements resulted in a really terrible worst-case for my WIP NRVO PR last year</p>



<a name="176744659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744659">(Sep 27 2019 at 13:19)</a>:</h4>
<p>if we regress memory on horrible crates and improve it on a lot of others, that's fine with me</p>



<a name="176744661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744661">(Sep 27 2019 at 13:19)</a>:</h4>
<p>so it stuck with me</p>



<a name="176744706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744706">(Sep 27 2019 at 13:19)</a>:</h4>
<p>hehe :)</p>



<a name="176744707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744707">(Sep 27 2019 at 13:19)</a>:</h4>
<p>anyway point was 128 might be a bit low, 2^16 is closer to what I've seen used in practice for SSA values</p>



<a name="176744713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744713">(Sep 27 2019 at 13:20)</a>:</h4>
<p>I'm going to make some coffee because I'm not seeing why it would regress memory :)</p>



<a name="176744782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744782">(Sep 27 2019 at 13:20)</a>:</h4>
<blockquote>
<p>anyway point was 128 might be a bit low, 2^16 is closer to what I've seen used in practice for SSA values</p>
</blockquote>
<p>that was just a random number I picked. Collecting data would be the best thing to find that number</p>



<a name="176744818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744818">(Sep 27 2019 at 13:21)</a>:</h4>
<p>there's also that whole "alias" idea I had, but that's only semi-related. it <em>is</em> very close to interning places per-body, depending on the semantics you pick</p>



<a name="176744820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744820">(Sep 27 2019 at 13:21)</a>:</h4>
<p>I feel like we could also extend that scheme so that <code>n + 0 =&gt; Place(Local(n), [])</code>, <code>n + 1 =&gt; Place(Local(n) [Field(0)])</code> up to some other number.</p>



<a name="176744822"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744822" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744822">(Sep 27 2019 at 13:21)</a>:</h4>
<blockquote>
<p>I'm going to make some coffee because I'm not seeing why it would regress memory <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>
</blockquote>
<p>if every index is only used once, then we use more memory for the index + vector scheme than for the direct scheme I think</p>



<a name="176744828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744828">(Sep 27 2019 at 13:21)</a>:</h4>
<p>But aren't we storing place's by value now?</p>



<a name="176744839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744839">(Sep 27 2019 at 13:21)</a>:</h4>
<p>So de duplicating the values should save <em>some</em> memory right?</p>



<a name="176744846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744846">(Sep 27 2019 at 13:21)</a>:</h4>
<p>oh god please don't do arithmetic coding in a compiler</p>



<a name="176744898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744898">(Sep 27 2019 at 13:22)</a>:</h4>
<p>that stuff is fun but not cheap on compute</p>



<a name="176744902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744902">(Sep 27 2019 at 13:22)</a>:</h4>
<p>I don't know what "arithmetic coding" is but</p>



<a name="176744909"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744909" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744909">(Sep 27 2019 at 13:22)</a>:</h4>
<p>I am still trying to sort out the variations</p>



<a name="176744914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744914">(Sep 27 2019 at 13:22)</a>:</h4>
<p>well, if deduplication doesn't actually deduplicate because every value is only used once, then we don't gain anything but may lose something</p>



<a name="176744926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744926">(Sep 27 2019 at 13:22)</a>:</h4>
<p>it seems to me that</p>



<a name="176744935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744935">(Sep 27 2019 at 13:22)</a>:</h4>
<blockquote>
<blockquote>
<p>what is the size of the entire <code>Place</code> going to be, then?</p>
</blockquote>
<p>I remember doing this silly thing to emulate quickly the sizes of these things <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=8ea6a738e3065c34837d9fde64f9091d" target="_blank" title="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=8ea6a738e3065c34837d9fde64f9091d">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=8ea6a738e3065c34837d9fde64f9091d</a></p>
</blockquote>
<p>Isn't this what <code>-Z print-type-sizes</code> is for?</p>



<a name="176744942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744942">(Sep 27 2019 at 13:22)</a>:</h4>
<p>if you (a) intern the projections to a list</p>



<a name="176744957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744957">(Sep 27 2019 at 13:23)</a>:</h4>
<p>(arithmetic coding is a trick used in compression, more often audio than general data compression, and it's also related to those tricks for fitting (Nat, Nat) into Nat, aka diagonalization or w/e)</p>



<a name="176744961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744961">(Sep 27 2019 at 13:23)</a>:</h4>
<p>I guess I assumed most locals were used at least twice (a read and write)</p>



<a name="176744965"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744965" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744965">(Sep 27 2019 at 13:23)</a>:</h4>
<p>ah, almost but not quite, dang it. I was <em>going</em> to say that <code>Place</code> coudl be copy, but the problem is I think we still have a <code>Box</code> for statics maybe?</p>



<a name="176744978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744978">(Sep 27 2019 at 13:23)</a>:</h4>
<p>anyway my point was this</p>



<a name="176744986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744986">(Sep 27 2019 at 13:23)</a>:</h4>
<p>if you reserve the first N places for locals</p>



<a name="176744988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744988">(Sep 27 2019 at 13:23)</a>:</h4>
<p>you can solve statics anyway so don't worry about them too much</p>



<a name="176744989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744989">(Sep 27 2019 at 13:23)</a>:</h4>
<p>you don't need to put them in the vector at all</p>



<a name="176744995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176744995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176744995">(Sep 27 2019 at 13:23)</a>:</h4>
<p>you can synthesize on demand</p>



<a name="176745004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745004">(Sep 27 2019 at 13:23)</a>:</h4>
<p>fn place(index: u32) -&gt; Place</p>



<a name="176745034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745034">(Sep 27 2019 at 13:24)</a>:</h4>
<p>so in that case it really isn't any less efficient, no?</p>



<a name="176745058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745058">(Sep 27 2019 at 13:24)</a>:</h4>
<p>(so the Nat thing is that you can fit tuples or lists of numbers into numbers, but it can get really expensive to decode, depending on how you're doing it)</p>



<a name="176745065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745065">(Sep 27 2019 at 13:24)</a>:</h4>
<p>(also it means we can set the threshold pretty high)</p>



<a name="176745097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745097">(Sep 27 2019 at 13:24)</a>:</h4>
<p>(the problem is statics, which would either have to be interned or solved in some other way)</p>



<a name="176745108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745108">(Sep 27 2019 at 13:25)</a>:</h4>
<p>but I think what all of this points to (in my mind) is that ultimately we probably want to intern the projections <em>and</em> the places</p>



<a name="176745109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745109">(Sep 27 2019 at 13:25)</a>:</h4>
<p>oh so basically some of the place indices are locals and others are projections thereof</p>



<a name="176745128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745128">(Sep 27 2019 at 13:25)</a>:</h4>
<p>right, so if you have a threshold H, then <code>fn place</code> is kind of:</p>



<a name="176745142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745142">(Sep 27 2019 at 13:25)</a>:</h4>
<p>and you can even define locals that way although it seems worrying. oh nvm what you're saying is what I thought everyone else was saying</p>



<a name="176745146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745146">(Sep 27 2019 at 13:25)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="k">fn</span> <span class="nf">place</span><span class="p">(</span><span class="n">index</span>: <span class="kt">u32</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">Place</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">  </span><span class="k">if</span><span class="w"> </span><span class="n">index</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">Place</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">local</span>: <span class="nc">index</span><span class="w"> </span><span class="p">};</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="w">  </span><span class="k">return</span><span class="w"> </span><span class="bp">self</span><span class="p">.</span><span class="n">place_vector</span><span class="p">[</span><span class="n">index</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">T</span><span class="p">];</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="176745147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745147">(Sep 27 2019 at 13:25)</a>:</h4>
<blockquote>
<blockquote>
<blockquote>
<p>what is the size of the entire <code>Place</code> going to be, then?</p>
</blockquote>
<p>I remember doing this silly thing to emulate quickly the sizes of these things <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=8ea6a738e3065c34837d9fde64f9091d" target="_blank" title="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=8ea6a738e3065c34837d9fde64f9091d">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=8ea6a738e3065c34837d9fde64f9091d</a></p>
</blockquote>
<p>Isn't this what <code>-Z print-type-sizes</code> is for?</p>
</blockquote>
<p>I did this because I needed to see how much was the size of doing <code>Box[T]</code> instead of the previous thing we had to see if was worth the change, changing the thing gave my a lot of compile errors, didn't want to make the refactor before being sure :)</p>



<a name="176745198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745198">(Sep 27 2019 at 13:26)</a>:</h4>
<p>in that case, if all you have is a ton of locals, we haven't done any extra work, no?</p>



<a name="176745201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745201">(Sep 27 2019 at 13:26)</a>:</h4>
<p>or am I missing something</p>



<a name="176745206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745206">(Sep 27 2019 at 13:26)</a>:</h4>
<p>the vector would be empty, and the only change is the sizeof(Place) is much smaller</p>



<a name="176745239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745239">(Sep 27 2019 at 13:26)</a>:</h4>
<p>okay yeah I would've assumed you don't store identity mappings anyway</p>



<a name="176745255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745255">(Sep 27 2019 at 13:27)</a>:</h4>
<p>so you were just assuming we'd set the threshold too low</p>



<a name="176745274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745274">(Sep 27 2019 at 13:27)</a>:</h4>
<p>yeah my old inflate comment was about 128 specifically</p>



<a name="176745277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745277">(Sep 27 2019 at 13:27)</a>:</h4>
<p>ok ok</p>



<a name="176745289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745289">(Sep 27 2019 at 13:27)</a>:</h4>
<p>so this comes back (for me) to: the logical first step is to intern projections :)</p>



<a name="176745294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745294">(Sep 27 2019 at 13:27)</a>:</h4>
<p>which can then be used to intern the entire place at some later point</p>



<a name="176745298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745298">(Sep 27 2019 at 13:28)</a>:</h4>
<p>in the meantime, it's gotta be better than <code>Box&lt;[...]&gt;</code></p>



<a name="176745337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745337">(Sep 27 2019 at 13:28)</a>:</h4>
<p>I think we can all agree on interning projections?</p>



<a name="176745347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745347">(Sep 27 2019 at 13:28)</a>:</h4>
<p>in fact I thought it was already happening</p>



<a name="176745353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745353">(Sep 27 2019 at 13:28)</a>:</h4>
<p>maybe I'm out of date :)</p>



<a name="176745385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745385">(Sep 27 2019 at 13:28)</a>:</h4>
<p>in that case, I think the <em>next</em> question would be what challenges exist to doing so, which comes back to the comment that I made a while back and how I would propose to address those challenges</p>



<a name="176745402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745402">(Sep 27 2019 at 13:29)</a>:</h4>
<p>but I'm going to stop typing for a sec because I want to see what <span class="user-mention" data-user-id="124288">@oli</span> and <span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> think :)</p>



<a name="176745420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745420">(Sep 27 2019 at 13:29)</a>:</h4>
<blockquote>
<p>in fact I thought it was already happening</p>
</blockquote>
<p>projections are not being interned, see meeting title <span aria-label="joy" class="emoji emoji-1f602" role="img" title="joy">:joy:</span></p>



<a name="176745525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745525">(Sep 27 2019 at 13:30)</a>:</h4>
<p>I mean that you were working towards it</p>



<a name="176745540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745540">(Sep 27 2019 at 13:30)</a>:</h4>
<p>yeah yeah, was kidding but yeah, I guessed we were already sold on it</p>



<a name="176745543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745543">(Sep 27 2019 at 13:31)</a>:</h4>
<p>so <span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="176745599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745599">(Sep 27 2019 at 13:31)</a>:</h4>
<blockquote>
<p>but I'm going to stop typing for a sec because I want to see what <span class="user-mention silent" data-user-id="124288">oli</span> and <span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> think :)</p>
</blockquote>
<p>so seems like there's a bunch of things that we all agree on?, I'd need to re-read the whole conversation to make some clear set of tasks</p>



<a name="176745613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745613">(Sep 27 2019 at 13:32)</a>:</h4>
<p>I guess this is what you were doing on HackMD <span class="user-mention" data-user-id="116009">@nikomatsakis</span> ?</p>



<a name="176745660"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745660" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745660">(Sep 27 2019 at 13:32)</a>:</h4>
<p>I mean, more or less taking some more clear things out :)</p>



<a name="176745661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745661">(Sep 27 2019 at 13:32)</a>:</h4>
<p>I guess one question is whether to intern projections to a <code>List&lt;&gt;</code> or some sort of per-mir index, but that seems like not the "high order bit" to me, it's to some extent the easiest part</p>



<a name="176745666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745666">(Sep 27 2019 at 13:32)</a>:</h4>
<p>that's what I was trying to do, yeah</p>



<a name="176745674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745674">(Sep 27 2019 at 13:32)</a>:</h4>
<p>I would definitely <em>start</em> with <code>List&lt;&gt;</code></p>



<a name="176745694"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745694" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745694">(Sep 27 2019 at 13:33)</a>:</h4>
<p>although... hmmm ...</p>



<a name="176745706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745706">(Sep 27 2019 at 13:33)</a>:</h4>
<p>yeah, to me is still not clear where to start</p>



<a name="176745711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745711">(Sep 27 2019 at 13:33)</a>:</h4>
<p>do I get rid of Static?</p>



<a name="176745717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745717">(Sep 27 2019 at 13:33)</a>:</h4>
<p>do I start interning projections?</p>



<a name="176745719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745719">(Sep 27 2019 at 13:33)</a>:</h4>
<p>I think that is clearly orthogonal</p>



<a name="176745720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745720">(Sep 27 2019 at 13:33)</a>:</h4>
<p>and things like that</p>



<a name="176745724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745724">(Sep 27 2019 at 13:33)</a>:</h4>
<p>getting rid of static</p>



<a name="176745752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745752">(Sep 27 2019 at 13:34)</a>:</h4>
<p>hold on, I'm rearranging a few things :)</p>



<a name="176745789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745789">(Sep 27 2019 at 13:34)</a>:</h4>
<p>so first thing to do would be to intern projections to <code>List</code></p>



<a name="176745810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745810">(Sep 27 2019 at 13:34)</a>:</h4>
<p>take a look at <a href="https://hackmd.io/vHP5hbCKQkq-HW_tnuAsoA" target="_blank" title="https://hackmd.io/vHP5hbCKQkq-HW_tnuAsoA">the hackmd</a> now</p>



<a name="176745834"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745834" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745834">(Sep 27 2019 at 13:34)</a>:</h4>
<p>I'm curious if everyone agrees with the organization I put there</p>



<a name="176745943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745943">(Sep 27 2019 at 13:36)</a>:</h4>
<p>I have to do a bit of code browsing though, the main reason I was thinking that maybe per-mir indices are "interesting" is that the MIR would still <em>own</em> their expanded contents</p>



<a name="176745949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745949">(Sep 27 2019 at 13:36)</a>:</h4>
<p>and hence <code>MutVisitor</code> might plausibly be retained in roughly its current form</p>



<a name="176745957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745957">(Sep 27 2019 at 13:36)</a>:</h4>
<blockquote>
<p>take a look at <a href="https://hackmd.io/vHP5hbCKQkq-HW_tnuAsoA" target="_blank" title="https://hackmd.io/vHP5hbCKQkq-HW_tnuAsoA">the hackmd</a> now</p>
</blockquote>
<p>seems good</p>



<a name="176745987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176745987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176745987">(Sep 27 2019 at 13:37)</a>:</h4>
<p>one thing I'm not entirely sure now is about the contruction step you mentioned at the beginning</p>



<a name="176746007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746007">(Sep 27 2019 at 13:37)</a>:</h4>
<p>yeah we could dig a bit into that</p>



<a name="176746008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746008">(Sep 27 2019 at 13:37)</a>:</h4>
<p>I mean, does it have some weird implication that I may not clearly see?</p>



<a name="176746017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746017">(Sep 27 2019 at 13:37)</a>:</h4>
<p>not that <em>I</em> see</p>



<a name="176746022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746022">(Sep 27 2019 at 13:37)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="176746025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746025">(Sep 27 2019 at 13:37)</a>:</h4>
<p>so, for everyone's context, what I was talking about is that</p>



<a name="176746040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746040">(Sep 27 2019 at 13:37)</a>:</h4>
<p>when building MIR, we have functions like <code>fn foo() -&gt; Place</code></p>



<a name="176746052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746052">(Sep 27 2019 at 13:37)</a>:</h4>
<p>we build things recursively</p>



<a name="176746106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746106">(Sep 27 2019 at 13:38)</a>:</h4>
<p>so if you have <code>a.b.c....z</code> you would wind up interning <code>.b</code>, <code>.b.c</code>, <code>.b.c.d</code> etc</p>



<a name="176746107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746107">(Sep 27 2019 at 13:38)</a>:</h4>
<p>seems bad</p>



<a name="176746112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746112">(Sep 27 2019 at 13:38)</a>:</h4>
<p>but we could refactor to something like <code>fn foo() -&gt; PlaceBuilder</code> that builds up a vector</p>



<a name="176746118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746118">(Sep 27 2019 at 13:38)</a>:</h4>
<p>and retain the "recursive" form</p>



<a name="176746126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746126">(Sep 27 2019 at 13:38)</a>:</h4>
<p>and then when we "convert" that to a <code>Place</code>, it would intern only once</p>



<a name="176746146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746146">(Sep 27 2019 at 13:38)</a>:</h4>
<p>yeah, that seems easy to do, was one of the things I had on my todo list</p>



<a name="176746149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746149">(Sep 27 2019 at 13:38)</a>:</h4>
<p>oooh that's what you meant by builder. basically <code>Place&lt;Vec&gt;</code> :P</p>



<a name="176746167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746167">(Sep 27 2019 at 13:39)</a>:</h4>
<p>yes</p>



<a name="176746182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746182">(Sep 27 2019 at 13:39)</a>:</h4>
<p>lol, you really want that generic thing :)</p>



<a name="176746185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746185">(Sep 27 2019 at 13:39)</a>:</h4>
<p>That seems much nicer than trying to radically rewrite construction to an iterative form which (imo) will also be less natural</p>



<a name="176746196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746196">(Sep 27 2019 at 13:39)</a>:</h4>
<p>Though I could be persuaded otherwise</p>



<a name="176746199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746199">(Sep 27 2019 at 13:39)</a>:</h4>
<p>but even then</p>



<a name="176746202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746202">(Sep 27 2019 at 13:39)</a>:</h4>
<p>I'd still want to do the builder approach <em>first</em></p>



<a name="176746204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746204">(Sep 27 2019 at 13:39)</a>:</h4>
<p>to try and separate concerns</p>



<a name="176746209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746209">(Sep 27 2019 at 13:39)</a>:</h4>
<blockquote>
<p>lol, you really want that generic thing :)</p>
</blockquote>
<p>which to be honest, seems good <span class="user-mention" data-user-id="119009">@eddyb</span></p>



<a name="176746216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746216">(Sep 27 2019 at 13:39)</a>:</h4>
<p>I'm vaguely negative on the generic thing :P</p>



<a name="176746271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746271">(Sep 27 2019 at 13:40)</a>:</h4>
<p>(we don't have HKT anyway)</p>



<a name="176746274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746274">(Sep 27 2019 at 13:40)</a>:</h4>
<p>only because ... how much code re-use are we really enabling here</p>



<a name="176746282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746282">(Sep 27 2019 at 13:40)</a>:</h4>
<p>and it seems overall less obvious to people reading the codebase</p>



<a name="176746291"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746291" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746291">(Sep 27 2019 at 13:40)</a>:</h4>
<blockquote>
<p>That seems much nicer than trying to radically rewrite construction to an iterative form which (imo) will also be less natural</p>
</blockquote>
<p>defitely, I have tried to do it and it's really less natural</p>



<a name="176746295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746295">(Sep 27 2019 at 13:40)</a>:</h4>
<p>this is a tuple of two fields people :P</p>



<a name="176746300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746300">(Sep 27 2019 at 13:40)</a>:</h4>
<p>existing construction matches up a list of projections much better though, because <code>Vec::push</code> is at the end - iteration is the problem, because it's from the start to the end but our projection recursions were always from the end</p>



<a name="176746328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746328">(Sep 27 2019 at 13:41)</a>:</h4>
<blockquote>
<p>and it seems overall less obvious to people reading the codebase</p>
</blockquote>
<p>agree on this yeah, I was mentioning the benefits, not the drawbacks :P</p>



<a name="176746336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746336">(Sep 27 2019 at 13:41)</a>:</h4>
<p>sorry, construction matches <em>what</em> better (and better than <em>what</em>)?</p>



<a name="176746360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746360">(Sep 27 2019 at 13:41)</a>:</h4>
<p>recursion -&gt; iterating tends to work out while recursion -&gt; iterat<em>or</em> is a hard problem in general</p>



<a name="176746365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746365">(Sep 27 2019 at 13:41)</a>:</h4>
<p>(it seems like <code>PlaceRef</code> is the "counterpart" to <code>PlaceBuilder</code>, for those cases where consuming by recursion is more natural, but those are relatively few)</p>



<a name="176746419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746419">(Sep 27 2019 at 13:42)</a>:</h4>
<p>ok so I think you mean <span class="user-mention" data-user-id="119009">@eddyb</span> that converting recursive code that <em>consumed</em> a place is relatively easy</p>



<a name="176746476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746476">(Sep 27 2019 at 13:42)</a>:</h4>
<p>But converting recursive code that <em>builds</em> a place, not so much</p>



<a name="176746505"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746505" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746505">(Sep 27 2019 at 13:42)</a>:</h4>
<p>(did I understand correctly?)</p>



<a name="176746541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746541">(Sep 27 2019 at 13:42)</a>:</h4>
<p>yeah, and it also feels pointless to turn things into iterators unless the data they're working on happens to be iterator-friendly in the first place</p>



<a name="176746548"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746548" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746548">(Sep 27 2019 at 13:43)</a>:</h4>
<blockquote>
<p>But converting recursive code that <em>builds</em> a place, not so much</p>
</blockquote>
<p>it definitely seems like that, and more with projection being a slice :)</p>



<a name="176746593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746593">(Sep 27 2019 at 13:43)</a>:</h4>
<p>as long as projections are always appended, the builder suggestion seems perfect and we don't need to bother with iterator contraptions</p>



<a name="176746649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746649">(Sep 27 2019 at 13:44)</a>:</h4>
<p>ok, so do we have consensus on <a href="#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Place's.20projection.20interning.20design.20meeting.20.3F/near/176746025" title="#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Place's.20projection.20interning.20design.20meeting.20.3F/near/176746025">this section on construction</a>?</p>



<a name="176746657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746657">(Sep 27 2019 at 13:44)</a>:</h4>
<p>(we can use SmallVec or something if really necessary etc.)</p>



<a name="176746682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746682">(Sep 27 2019 at 13:44)</a>:</h4>
<blockquote>
<p>yeah, and it also feels pointless to turn things into iterators unless the data they're working on happens to be iterator-friendly in the first place</p>
</blockquote>
<p>one of the cool things I ended adding is <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_mir/build/matches/mod.rs#L1300" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc_mir/build/matches/mod.rs#L1300">https://github.com/rust-lang/rust/blob/master/src/librustc_mir/build/matches/mod.rs#L1300</a>, unsure if people have different opinions</p>



<a name="176746692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746692">(Sep 27 2019 at 13:44)</a>:</h4>
<p>but in general you need the elem and the proj_base</p>



<a name="176746700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746700">(Sep 27 2019 at 13:45)</a>:</h4>
<p>that link didn't work for me</p>



<a name="176746724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746724">(Sep 27 2019 at 13:45)</a>:</h4>
<p>woah</p>



<a name="176746727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746727">(Sep 27 2019 at 13:45)</a>:</h4>
<p>sorry, took that from a current local branch</p>



<a name="176746729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746729">(Sep 27 2019 at 13:45)</a>:</h4>
<p>oh, that's the recursive stuff I was talking about</p>



<a name="176746748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746748">(Sep 27 2019 at 13:45)</a>:</h4>
<p>yeah, makes sense</p>



<a name="176746798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746798">(Sep 27 2019 at 13:46)</a>:</h4>
<p>I feel like it might be more obvious if we encapsulated that in a pattern but +1 overall</p>



<a name="176746825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746825">(Sep 27 2019 at 13:46)</a>:</h4>
<blockquote>
<p>I feel like it might be more obvious if we encapsulated that in a pattern but +1 overall</p>
</blockquote>
<p>say more about that, unsure I got it :)</p>



<a name="176746855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746855">(Sep 27 2019 at 13:47)</a>:</h4>
<p>we used to do this a lot even with the recursive projections, because loops are nicer than writing recursive functions most of the time</p>



<a name="176746861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746861">(Sep 27 2019 at 13:47)</a>:</h4>
<p>the bad thing is having the mut cursor around, but with that pattern there seems a nice way to iterate</p>



<a name="176746883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746883">(Sep 27 2019 at 13:47)</a>:</h4>
<p>I was just saying that I'd imagine that code to be also expressable via something like:</p>
<div class="codehilite"><pre><span></span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">cursor</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">PlaceRef</span>::<span class="n">from</span><span class="p">(...);</span><span class="w"></span>
<span class="k">while</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">elem</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">cursor</span><span class="p">.</span><span class="n">pop_back</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="p">...</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="176746904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746904">(Sep 27 2019 at 13:47)</a>:</h4>
<p>you can just use a slice iterator, I think?</p>



<a name="176746937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746937">(Sep 27 2019 at 13:48)</a>:</h4>
<p>where <code>pop_back</code> returns <code>&amp;mut ProjectionElement</code> and adjusts the <code>cursor</code> in place</p>



<a name="176746953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746953">(Sep 27 2019 at 13:48)</a>:</h4>
<p>(and yeah I think there are some slice methods that are similar)</p>



<a name="176746998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176746998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176746998">(Sep 27 2019 at 13:48)</a>:</h4>
<p>like, <code>std::slice::Iter</code> has a method to turn it back into a slice, I think</p>



<a name="176747026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747026">(Sep 27 2019 at 13:49)</a>:</h4>
<p>e.g., <code>cursor.split_last_mut</code>, analogous to <a href="https://doc.rust-lang.org/std/primitive.slice.html#method.split_last_mut" target="_blank" title="https://doc.rust-lang.org/std/primitive.slice.html#method.split_last_mut">slice:split_last_mut</a></p>



<a name="176747035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747035">(Sep 27 2019 at 13:49)</a>:</h4>
<p>yeah but I think we want methods on <code>PlaceRef</code></p>



<a name="176747044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747044">(Sep 27 2019 at 13:49)</a>:</h4>
<p>that retain the placebase</p>



<a name="176747064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747064">(Sep 27 2019 at 13:49)</a>:</h4>
<p>I mean you can also do it on slices, but e.g. see <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_mir/build/matches/mod.rs#L1307" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc_mir/build/matches/mod.rs#L1307">this cod here</a>, that rebuilds the <code>PlaceRef</code></p>



<a name="176747069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747069">(Sep 27 2019 at 13:49)</a>:</h4>
<p>anyway, a bit afield</p>



<a name="176747159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747159">(Sep 27 2019 at 13:50)</a>:</h4>
<p>we've only got 10 minutes before design meeting</p>



<a name="176747164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747164">(Sep 27 2019 at 13:50)</a>:</h4>
<p>it seems like we settled a lot</p>



<a name="176747186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747186">(Sep 27 2019 at 13:50)</a>:</h4>
<p>I was going to say exactly that</p>



<a name="176747191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747191">(Sep 27 2019 at 13:50)</a>:</h4>
<p>yeah</p>



<a name="176747204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747204">(Sep 27 2019 at 13:51)</a>:</h4>
<p>so, I can start with things from <a href="https://hackmd.io/vHP5hbCKQkq-HW_tnuAsoA?view" target="_blank" title="https://hackmd.io/vHP5hbCKQkq-HW_tnuAsoA?view">https://hackmd.io/vHP5hbCKQkq-HW_tnuAsoA?view</a></p>



<a name="176747215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747215">(Sep 27 2019 at 13:51)</a>:</h4>
<p>I think one open question that remains is what to do about the <code>MutVisitor</code>, but I want to investigate if we could <em>start</em> (and maybe finish!) by moving to per-MIR indices, though that carries some 'portability' cost of its own, not sure if that's easier (in particular, you can't just deref the projections slice anymore, ooooh, right, and these tricks you're doing here wouldn't work)</p>



<a name="176747220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747220">(Sep 27 2019 at 13:51)</a>:</h4>
<p>never mind, I think we should do <code>List&lt;&gt;</code> first :)</p>



<a name="176747238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747238">(Sep 27 2019 at 13:51)</a>:</h4>
<p>yeah to both things :)</p>



<a name="176747257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747257">(Sep 27 2019 at 13:52)</a>:</h4>
<p>well, I guess you still <em>could</em></p>



<a name="176747295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747295">(Sep 27 2019 at 13:52)</a>:</h4>
<p>do the slicing tricks</p>



<a name="176747316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747316">(Sep 27 2019 at 13:52)</a>:</h4>
<p>but it wouldl still mean that you need to do something like <code>mir.projections(index)</code> instead of just <code>place.projections</code></p>



<a name="176747317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747317">(Sep 27 2019 at 13:52)</a>:</h4>
<blockquote>
<p>do the slicing tricks</p>
</blockquote>
<p>what do you mean?</p>



<a name="176747340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747340">(Sep 27 2019 at 13:52)</a>:</h4>
<p>what I mean is that <code>mir.projections(index)</code> can return a <code>&amp;[Projection]</code> borrowed from the MIR, which can be sliced etc. But that might be a pain sometimes.</p>



<a name="176747349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747349">(Sep 27 2019 at 13:52)</a>:</h4>
<p>having <code>a.b.c</code> not take up extra interning memory if <code>a.b.c.d</code> exists</p>



<a name="176747370"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747370" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747370">(Sep 27 2019 at 13:53)</a>:</h4>
<p>no, I didn't actually mean that</p>



<a name="176747372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747372">(Sep 27 2019 at 13:53)</a>:</h4>
<p>oh</p>



<a name="176747377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747377">(Sep 27 2019 at 13:53)</a>:</h4>
<p>although that's a thing too :)</p>



<a name="176747483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747483">(Sep 27 2019 at 13:54)</a>:</h4>
<p>what I mean is that if you have</p>
<div class="codehilite"><pre><span></span><span class="k">struct</span> <span class="nc">Place</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">base</span>: <span class="p">...,</span><span class="w"> </span><span class="n">projections</span>: <span class="nc">ProjectionIndex</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
</pre></div>



<a name="176747499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747499">(Sep 27 2019 at 13:54)</a>:</h4>
<p>and you had that index into a list of projections on the MIR</p>



<a name="176747520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747520">(Sep 27 2019 at 13:54)</a>:</h4>
<p>that'd have some interesting characteristics but would also be a pain and overall I don't think it's the right first step (and maybe not ever right)</p>



<a name="176747567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747567">(Sep 27 2019 at 13:55)</a>:</h4>
<p>what you're saying <span class="user-mention" data-user-id="124288">@oli</span> seems to be more about <code>&amp;[Projection]</code> vs <code>List&lt;Projection&gt;</code>, confirm?</p>



<a name="176747577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747577">(Sep 27 2019 at 13:55)</a>:</h4>
<p>yes</p>



<a name="176747606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747606">(Sep 27 2019 at 13:55)</a>:</h4>
<p>( I noted it in the hackmd, btw, it wasn't something we'd explicitly discussed before )</p>



<a name="176747611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747611">(Sep 27 2019 at 13:55)</a>:</h4>
<p><span aria-label="time" class="emoji emoji-1f557" role="img" title="time">:time:</span> 5 minute warning</p>



<a name="176747627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747627">(Sep 27 2019 at 13:55)</a>:</h4>
<p>Yep, thanks &lt;3</p>



<a name="176747683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747683">(Sep 27 2019 at 13:56)</a>:</h4>
<p>so the nice thing is</p>



<a name="176747691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747691">(Sep 27 2019 at 13:56)</a>:</h4>
<p>that I think the first steps for construction are something <span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> can pursue</p>



<a name="176747703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747703">(Sep 27 2019 at 13:56)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="176747704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747704">(Sep 27 2019 at 13:56)</a>:</h4>
<p>i.e., you can port over to a <code>PlaceBuilder</code> that builds a <code>Vec</code></p>



<a name="176747712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747712">(Sep 27 2019 at 13:56)</a>:</h4>
<p>where the final step converts frm <code>Vec</code> to the <code>Box&lt;[...]&gt;</code> we have today</p>



<a name="176747720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747720">(Sep 27 2019 at 13:56)</a>:</h4>
<p>(in fact, I'm not sure what we're doing today? reallocating?)</p>



<a name="176747724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747724">(Sep 27 2019 at 13:56)</a>:</h4>
<p>(deleted)</p>



<a name="176747743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747743">(Sep 27 2019 at 13:56)</a>:</h4>
<p>and that gives time to work out the remaining questions...</p>



<a name="176747752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747752">(Sep 27 2019 at 13:56)</a>:</h4>
<blockquote>
<p>that I think the first steps for construction are something <span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> can pursue</p>
</blockquote>
<p>yes and it's definitely a very easy thing to do</p>



<a name="176747815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747815">(Sep 27 2019 at 13:57)</a>:</h4>
<blockquote>
<p>(in fact, I'm not sure what we're doing today? reallocating?)</p>
</blockquote>
<p>yes, I think so</p>



<a name="176747883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747883">(Sep 27 2019 at 13:58)</a>:</h4>
<p>should be a nice win for such an easy change I think</p>



<a name="176747908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747908">(Sep 27 2019 at 13:58)</a>:</h4>
<p>yep</p>



<a name="176747946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747946">(Sep 27 2019 at 13:59)</a>:</h4>
<p>cool, gotta run, any final thoughts? take a look at the <a href="https://hackmd.io/vHP5hbCKQkq-HW_tnuAsoA?edit" target="_blank" title="https://hackmd.io/vHP5hbCKQkq-HW_tnuAsoA?edit">hackmd doc</a>, maybe <span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> you want to add it to the compiler-team repo as minutes?</p>



<a name="176747982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176747982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176747982">(Sep 27 2019 at 13:59)</a>:</h4>
<p>I can definitely do that</p>



<a name="176748011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/176748011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#176748011">(Sep 27 2019 at 13:59)</a>:</h4>
<p>and don't have any other thoughts for now, so <span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span> from my side :)</p>



<a name="177079449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177079449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177079449">(Oct 01 2019 at 17:43)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> <span class="user-mention" data-user-id="116009">@nikomatsakis</span> you have mentioned in the meeting, a possible use of <code>SmallVec</code> for construction, if I got it right</p>



<a name="177079563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177079563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177079563">(Oct 01 2019 at 17:44)</a>:</h4>
<p>with projection being a <code>Box&lt;PlaceElem&lt;'tcx&gt;&gt;</code> I think that using <code>SmallVec</code> is worser than just a <code>Vec</code></p>



<a name="177079650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177079650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177079650">(Oct 01 2019 at 17:45)</a>:</h4>
<p>because at the end, when you do <code>into_place</code> on the builder you need to convert to <code>Box</code></p>



<a name="177079699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177079699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177079699">(Oct 01 2019 at 17:45)</a>:</h4>
<p>on <code>SmallVec</code> in order to go to <code>Box</code> you need to go through <code>Vec</code></p>



<a name="177079813"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177079813" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177079813">(Oct 01 2019 at 17:46)</a>:</h4>
<p>still that doesn't matter, the thing is you'd need to reallocate on the heap no matter how big or small that <code>SmallVec</code> is</p>



<a name="177079890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177079890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177079890">(Oct 01 2019 at 17:47)</a>:</h4>
<p>I guess you were talking about possible wins with the <code>SmallVec</code> approach once we go to the interned projection solution</p>



<a name="177079891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177079891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177079891">(Oct 01 2019 at 17:47)</a>:</h4>
<p>right?</p>



<a name="177089264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177089264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177089264">(Oct 01 2019 at 19:28)</a>:</h4>
<p>I'm confused</p>



<a name="177089287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177089287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177089287">(Oct 01 2019 at 19:28)</a>:</h4>
<p>I think what we meant was that</p>



<a name="177089294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177089294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177089294">(Oct 01 2019 at 19:28)</a>:</h4>
<p>the builder would contain a <code>SmallVec&lt;Projection&gt;</code></p>



<a name="177089303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177089303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177089303">(Oct 01 2019 at 19:28)</a>:</h4>
<p>maybe I need to check your PR to see what approach you used though</p>



<a name="177089341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177089341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177089341">(Oct 01 2019 at 19:29)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <a href="https://github.com/rust-lang/rust/pull/64922" target="_blank" title="https://github.com/rust-lang/rust/pull/64922">https://github.com/rust-lang/rust/pull/64922</a></p>



<a name="177089343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177089343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177089343">(Oct 01 2019 at 19:29)</a>:</h4>
<p>it's very simple</p>



<a name="177089381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177089381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177089381">(Oct 01 2019 at 19:29)</a>:</h4>
<p>I guessed that you wanted me to use <code>SmallVec</code> instead of <code>Vec</code> in the builder, but to me doesn't seem to make a lot of sense until we move to interning</p>



<a name="177089396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177089396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177089396">(Oct 01 2019 at 19:29)</a>:</h4>
<p>unsure, I may have understood something wrong</p>



<a name="177089474"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177089474" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177089474">(Oct 01 2019 at 19:30)</a>:</h4>
<p>basically there are two things related to that PR</p>



<a name="177089486"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177089486" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177089486">(Oct 01 2019 at 19:30)</a>:</h4>
<p>one is that it's not giving a huge perf improvement</p>



<a name="177089500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177089500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177089500">(Oct 01 2019 at 19:30)</a>:</h4>
<p>and the other is that one about <code>SmallVec</code></p>



<a name="177089831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177089831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177089831">(Oct 01 2019 at 19:34)</a>:</h4>
<blockquote>
<p>I guessed that you wanted me to use <code>SmallVec</code> instead of <code>Vec</code> in the builder, but to me doesn't seem to make a lot of sense until we move to interning</p>
</blockquote>
<p>oh, I see, because we're going to have to make a <code>Box&lt;[Elem]&gt;</code> eventually, you're saying</p>



<a name="177089872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177089872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177089872">(Oct 01 2019 at 19:35)</a>:</h4>
<p>yeah that seems fine</p>



<a name="177090005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177090005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177090005">(Oct 01 2019 at 19:36)</a>:</h4>
<p>seems fine means that I'm correct or that I need to do that and it will be fine</p>



<a name="177090021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177090021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177090021">(Oct 01 2019 at 19:36)</a>:</h4>
<p>to me seems like I'd be converting back and forth with no wins</p>



<a name="177090028"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177090028" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177090028">(Oct 01 2019 at 19:36)</a>:</h4>
<p>yeah, it's just a micro-optimization at best anyway</p>



<a name="177090059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177090059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177090059">(Oct 01 2019 at 19:37)</a>:</h4>
<p>yeah but I guess that works once you want to go to things like <code>&amp;[T]</code></p>



<a name="177090120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177090120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177090120">(Oct 01 2019 at 19:38)</a>:</h4>
<p>so when <code>projection</code> as <code>SmallVec</code> is small and it's there as an array you can just use a pointer to it, or even copy the array</p>



<a name="177090171"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177090171" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177090171">(Oct 01 2019 at 19:38)</a>:</h4>
<p>but not if at the end you need to convert to <code>Box</code></p>



<a name="177090191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177090191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177090191">(Oct 01 2019 at 19:38)</a>:</h4>
<p>it's like you start with an array to avoid allocating on the heap but end allocating there anyway</p>



<a name="177090202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177090202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177090202">(Oct 01 2019 at 19:38)</a>:</h4>
<p>so seems better to just go with Vec since the beginning</p>



<a name="177090374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177090374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177090374">(Oct 01 2019 at 19:41)</a>:</h4>
<p>I think <code>SmallVec</code> might help because, when you do the interning, you need to copy to the <code>Arena</code>. So by using <code>SmallVec</code> we potentially avoid allocating a <code>Vec</code> that just gets copied into the <code>Arena</code> and then discarded.</p>



<a name="177090418"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177090418" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177090418">(Oct 01 2019 at 19:42)</a>:</h4>
<p>But yeah, if we're not interning yet, then its probably not actually an optimization.</p>



<a name="177090483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177090483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177090483">(Oct 01 2019 at 19:42)</a>:</h4>
<p>exactly, I was saying it doesn't seem to be useful meanwhile we are not interning</p>



<a name="177090490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Place%27s%20projection%20interning%20design%20meeting%20%3F/near/177090490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Place&#x27;s.20projection.20interning.20design.20meeting.20.3F.html#177090490">(Oct 01 2019 at 19:42)</a>:</h4>
<p>after interning is a different story :)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>